package com.tuyue.police.dao;

import com.tuyue.police.pojo.Enterprise;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @Author: 王金海
 * @Description:
 * @Date: Created by Administrator on 2018/3/13.
 * @Modified By:
 */
public interface IEnterpriseDao extends JpaRepository<Enterprise,Long> {

    Page<Enterprise> findAllByEUserId(Long userId,Pageable pageable);
    @Query("select e from Enterprise e where e.eUserId=?1")
    List<Enterprise> findEnterpriseLit(Long userId);

    @Query("select e.eId from Enterprise e where e.eUserId=?1")
    List<Long> findByUserId(Long userId);
}
